The present invention generally relates to memory control and especially relates to leveling of the NOEs (the numbers of times of erasure) of multiple physical areas in a memory. NAND flash memory includes multiple physical blocks, and each physical block includes multiple physical pages, and data is outputted and inputted per page (physical page), and data is erased per block (physical block). Generally a memory controller of NAND flash memory is configured to perform leveling of the NOEs (the numbers of times of erasure) of multiple physical blocks, namely, perform wear leveling processing.
For example, the wear leveling processing disclosed in Literature 1 (JP2005-275722) is as follows. That is, the NOE is managed as for each of multiple physical blocks in a flash memory. When the difference between the Max-NOE (the maximum NOE) and the Min-NOE (the minimum NOE) exceeds a threshold value, the data stored in the physical block with the Min-NOE is copied to a spare block (a copy destination block), and the copy source block (the physical block with Min-NOE) allocated to the logical address is replaced with the copy destination block, and the copy source block is managed as a spare block.